# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-dunamai
pkgver=1.19.0
pkgrel=0
pkgdesc="Dynamic versioning library and CLI"
url="https://github.com/mtkennerly/dunamai"
arch="noarch"
license="MIT"
depends="py3-packaging"
makedepends="py3-gpep517 py3-poetry-core py3-wheel py3-installer"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/mtkennerly/dunamai/releases/download/v$pkgver/dunamai-$pkgver.tar.gz"
builddir="$srcdir/dunamai-$pkgver"
options="!check" # tests require a git repo

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
6d1160ad241dd3485ee7c7edf5e19c682ae020ce1094186a04c2b6dde9a315af17ddf2fa80bed96a80e6d9d43050f4a6a08ef04356bed65d367e70371a9862eb  dunamai-1.19.0.tar.gz
"
